LotusScript Doc

Class: LSANamedList

The class maintaines a list of items which rely on the AnyItem interface. Classes which implement this interface, e.g. LSAWebPageItem, provide the accessors to the attribute "key" and to the methods "implode" and "explode". Because this kind of interface is used the items cannot be instantiated in this class. To add a new item to the list the item has to be instantiated from outside and passed in as parameter. '

Version:
1.2.5, 19.SEP.2000 <BR>
History:
19.SEP.2000RGRerrorhandling in add item improved
11.AUG.2000RGRValidation added in updateCurrentItem
27.JUL.2000RGRnew function updateAllItems
27.JUL.2000RGRgetItemByKey method changed



Property Summary
Public Property Get Count As Integer
Public Property Set CurrentItemKey As String
Public Property Get CurrentItemKey As String
Public Property Set DefaultItemKey As String
Public Property Get DefaultItemKey As String
Public Property Set FirstItemKey As String
Public Property Get FirstItemKey As String
Public Property Set ListDelimiter As String
Public Property Get ListDelimiter As String

Method Summary
Sub AddItem (NewItem As Variant)
Sub ClearAllItems ()
Sub ClearCurrentItem ()
Sub Delete ()
Sub GetItemByKey (ItemKey As String, TargetItem As Variant, MoveCurrentKey As Integer)
Function GetNextItemKey () As String
Function GetNthPositionArray (pos As Integer) As Variant
Function GetPreviousItemKey () As String
Function implodeToArray () As Variant
Function implodeToSerialData () As String
Function IsElementByKey (queryKey As String) As Integer
Sub New ()
Sub refreshAllItems (ModelItem As Variant)
Sub updateCurrentItem (updateItem As Variant)

Property Detail

Public Property Set CurrentItemKey AsString

Points to an item of the list. Is used to navigate through the list

Summmary Top

Public Property Get CurrentItemKey AsString

Summmary Top

Public Property Set DefaultItemKey AsString

Points to an item of the list. One Element can be marked as default item.

Summmary Top

Public Property Get DefaultItemKey AsString

Summmary Top

Public Property Set FirstItemKey AsString

Points to the first item of the list

Summmary Top

Public Property Get FirstItemKey AsString

Summmary Top

Public Property Get Count AsInteger

Delivers the number of elements of the maintained list

Summmary Top

Public Property Set ListDelimiter AsString

When the object is imploded to a serial data string this character will be used as seperator. If the programmer doesn't set a delimiter a default value will be delivered by the class.

Summmary Top

Public Property Get ListDelimiter AsString

Summmary Top
Method Detail

New

Public Sub New
Initiates the counter to the value 0 and sets the default for the delimiter.

Summmary Top

Delete

Public Sub Delete
This is the standard destructor of the class

Summmary Top

AddItem

Public Sub AddItem(NewItem As Variant)
Adds a new item to the list. The position in the list of the new item is after the item marked as current item.

Parameters:
newItemAnyItemthe item which is added to the list
Errors:
ErrItemKeyDublicate
History:
19.SEP.2000RGRset ErrPrm for dublicate keys
Summmary Top

ClearCurrentItem

Public Sub ClearCurrentItem
Deletes the item at which the CurrentItemKey is pointing at from the list. If FirstItem or DefaultItem is set to the item which should be deleted the pointers are set to the next item in the list.

Summmary Top

ClearAllItems

Public Sub ClearAllItems
Reinitialize the list.

Summmary Top

GetItemByKey

Public Sub GetItemByKey(ItemKey As String,TargetItem As Variant,MoveCurrentKey As Integer)
Gets an item from the list by its key. Because the class doesn't know what kind of item is maintained in the list, it cannot create new instances. Therefore the result item (TargetItem) has to be provided by calling function. This function will return the item with defined key. If the item cannont be found an eempty object (Nothing) is returned. If the parameter MoveCurrentKey is set to true, the CurrentItemKey property will point to the found key after execution.

Parameters:
itemKeyStringkey of the item which is searched
targetItemAnyItemitem to store the result
moveCurrentKeyBooleanif true CurrentItemKey = ItemKey after search
History:
27.JUL.2000RGRReturns empty if item cannot be found
Summmary Top

GetNextItemKey

Public Function GetNextItemKey As String
Returns the key of the item next to the item at which the CurrentItemKey attribute is pointing. If no elements are in the list an empty string("") is returned.

Summmary Top

GetPreviousItemKey

Public Function GetPreviousItemKey As String
Returns the key of the item previous to the item at which the CurrentItemKey attribute is pointing. If no elements are in the list an empty string("") is returned.

Summmary Top

updateCurrentItem

Public Sub updateCurrentItem(updateItem As Variant)
Updates the item at which the CurrentItemKey attribute is pointing with the values of the item, passed in as parameter

Parameters:
updateItemVariantthe item which is used for the update
History:
11.AUG.2000RGRValidation added in updateCurrentItem
Summmary Top

refreshAllItems

Public Sub refreshAllItems(ModelItem As Variant)
Updates all items in the list, which means that the formatted properties of all items are refeshed.

Summmary Top

implodeToArray

Public Function implodeToArray As Variant
Returns an array with the serialized item objects as values. Each element will be extended with the information if it is the default value or not

Summmary Top

implodeToSerialData

Public Function implodeToSerialData As String
Returns a serial data string with the serialized item objects as datablocks.

Errors:
ErrItemDelimiterDoesntMatchthrown if items use different delimiters
Summmary Top

GetNthPositionArray

Public Function GetNthPositionArray(pos As Integer) As Variant
Extracts nth position from the serial data array which is build by the implodeToArray method

Parameters:
posIntegerthe column which should be extracted
Errors:
ErrDataDoesntCorrespondToObject
Summmary Top

IsElementByKey

Public Function IsElementByKey(queryKey As String) As Integer
Checks if an element with the key queryKey is an element of the list.

Summmary Top

TopLotusScript Doc
© Lotus Professional Services
generated on : 05-Apr-01 8:45:34 AM